from bzrc import BZRC
import sys

Class SearchGraph(object):

	def __init__(self, bzrc, tankid):
		self.bzrc = bzrc
		self.pos, self.grid = bzrc.get_occgrid(tankid)

	def is_occupied(x, y)
		return (self.grid[x][y] == 1)

	#tests if the coordinates are adjacent to an occupied space
	def is_adjacent(x, y)
		if (self.grid[x][y+1] == 1)
			return True
		if (self.grid[x+1][y+1] == 1)
			return True
		if (self.grid[x-1][y+1] == 1)
			return True
		if (self.grid[x-1][y] == 1)
			return True
		if (self.grid[x+1][y] == 1)
			return True
		if (self.grid[x+1][y-1] == 1)
			return True
		if (self.grid[x][y-1] == 1)
			return True
		if (self.grid[x-1][y-1] == 1)
			return True
		return False
		
